from model import Model, Dao

class Restaurant(Model):
    def __init__(self, _dict):
        Model.__init__(self, _dict)
        
        self.name = _dict['name']
        self.description = _dict['description']
        #self.style = _dict['style']
        #self.phone = _dict['phone']
        #self.office_hour = _dict['office-hour']
        
        

        # associate fields must contain model
        self.address = _dict['address']


class RestaurantDao(Dao):
    def __init__(self):
        Dao.__init__(self, Restaurant)
        self.collection = 'restaurants'
        # associates { field name : collection name }
        self.ref_collections = {'address':'addresses'}
        
        
if __name__ == '__main__':
    # create table
    #db.drop_all()
    #db.create_all()
    pass